<template>
	<view class="u-margin-left-20 u-margin-right-20" v-if="info.modelImgListUrl">
		<view class="uni-margin-wrap">
			<swiper class="swiper" circular :indicator-dots="none" :autoplay="autoplay" :interval="interval"
				:duration="duration">
				<swiper-item v-for="(item, index) in info.modelImgListUrl" :key="index">
					<view class="swiper-item">
						<image class="swiperImg" :src="item" alt="" @click="preview(index)"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>

		<view class="wrap wrapss" style="padding: 10px;position: relative;">
			<view class="title" style="margin-bottom: 25rpx;">户型名称: {{info.modelName}}</view>

			<image v-if="info.notVr==2"
				style="width: 40rpx;height: 40rpx;border-radius: 50%;position: absolute;top: 20rpx;right: 20rpx;"
				src="/static/vr.png" mode="" @tap.stop="vr(info)"></image>

			<view v-if="info.minArea != info.maxArea" class="title-deatil">
				面积: {{info.minArea}}-{{info.maxArea}}平方米
			</view>
			<view v-else class="title-deatil">
				面积: {{info.minArea}}平方米
			</view>
			<div class="titleList">
				<!-- <div class="titleListli">
					?? 房源紧缺｜近期968人到店
				</div> -->
				<div v-if="i.length>0" class="titleListli" v-for="i in info.labelList">
					{{i}}
				</div>
			</div>
			<!-- <div class="label">
				<div class="lab" style="background-color: #e0f3fe; color: #00a0f5;">免租30天</div>
				<div class="lab" v-for="(item, index) in tipList" :key="index">{{item}}</div>
			</div> -->

			<view class="pCon">
				<view class="hlef" style="width: 100%;">
					<span v-if="item.minPrice==0"
						style="color: #ff7336;margin-right: 5rpx;font-size: 26rpx;">{{item.maxPrice}}</span>
					<span class="bRed" v-if="info.minPrice != info.maxPrice">租金： <span
							class="mon-y">{{info.minPrice}}-{{info.maxPrice}}</span></span>
					<span class="bRed" v-else-if="info.minPrice == info.maxPrice">租金： <span
							class="mon-y">{{info.minPrice}}</span></span>
					<span class="bRed" v-else-if="info.minPrice == 0">租金： <span
							class="mon-y">{{info.maxPrice}}</span></span>

					<span class="mon-s">元/月</span>
				</view>
			</view>
		</view>

		<!--户型房源-->
		<div class="wrap" style="overflow: hidden;box-shadow: 0.5px 0.5px 5px 0px rgba(0, 0, 0, 0.1);">
			<div class="nav">
				<div class="navLi" :class="item.checked==true?'navLiRadio':''" v-for="(item,index) in navLi"
					:key="index" @tap.stop="navLine(index)">
					{{item.h}}
					<!-- <div class="navLine">11212312</div> -->
				</div>
			</div>
			<div class="hxCon" v-show="navValue == 0">
				<!-- <div class="label">
					<div class="lab2" v-for="(item, index) in tipList" v-bind:key="index">{{item}}</div>
				</div> -->
				<div class="tab">
					<!-- <div class="tab-left">
						<div class="tab-item" v-for="(item, index) in screen" :key="index">{{item.h}}</div>
						<div class="tab-item" style="display:flex;justify-content: center;">
							朝向 -->
					<!-- <img src="" alt="" style="width: 10rpx;height: 10rpx;background-color: #777;"> -->
					<!-- </div>
					</div> -->
					<!-- 	<div class="tab-right">
						<div class="tab-item" :class="item.checked==true?'tabItemChecked':''" style="margin: 0;"
							v-for="(item, index) in screen_h" :key="index" @click="tabItemChecked(index)">{{item.h}}
						</div>
					</div> -->

				</div>
				<!-- 楼层筛选 -->
				<div class="listCon" v-if="jg == true" style="display: flex;margin: 20rpx 1%;">
					<div class="lcsx-left">
						<div class="lcsx-left-item">
							8f
						</div>
					</div>
					<div class="lcsx-right" v-for="(i,id) in modelList" :key="id">
						<div class="lcsx-right-h">
							8f
						</div>
						<div class="lcsx-right-item">
							<img class="lcsx-right-item-img" src="" alt="">
							<div class="lcsx-right-item-h">
								公寓-842房
							</div>
							<div class="lcsx-right-item-text">
								8/14·单间
							</div>
							<div class="lcsx-right-item-tabs">
								<span class="lcsx-right-item-tabs-item">房间</span>
								<span class="lcsx-right-item-tabs-item">房间</span>
								<span class="lcsx-right-item-tabs-item">房间</span>
								<span class="lcsx-right-item-tabs-item">房间</span>
							</div>
							<div class="lcsx-jg">
								<span style="color: #ff953f;">1280</span>
								<span style="font-size: 20rpx;">/月</span>
							</div>

							<img class="sc" v-if="item.checked==false" @tap.stop='collect(item,1)'
								src="../../static/sc.png" alt="">
							<img class="sc" v-else @tap.stop='collect(item,0)' src="../../static/ysc.png" alt="">
						</div>
					</div>
				</div>

				<scroll-view scroll-y="true" class="hxCon" v-if="jg == false" @scrolltolower="lower">
					<ul class="ul" style="padding: 0;" v-if="modelList.total>0">
						<li class="li">
						<li class="li" v-for="(item , i) in rows" :key="i" @click='linkDetail(item)'>
							<view class="liWrap">
								<!-- <div class="po">{{item.num}}间</div> -->
								<div class="img" style="position: relative;">
									<img v-if="item.roomImg != null" :src="item.roomUrl" class="img" alt="">
									<img v-else :src="info.showUrl" class="img" alt="">

									<div class="imgPo" @click.stop="lookTV(item)"
										v-if="item.appId && item.path && item.broadcastNum">
										<img src="https://gateway.yijushenyang.com/static/index/playiconred.gif"
											style="width: 14px;height: 14px;" alt="">
									</div>
								</div>

								<view class="msg">
									<view class="poCur">{{item.sum_floor}}</view>
									<view class="p1"><span class="b">房号:
											{{item.roomNum}}</span> <!-- <span
											style="font-size: 12px;">元/月</span> --></view>
									<view class="p1">
										<span class="b">面积: {{item.area}}m²</span>
										<!-- <span class="b">{{}}</span> -->
									</view>
									<view class="p1 p2">
										<!-- <view class="p1 p2" v-if="item.label.length>0"> -->
										<span class="bCur">{{item.toward}}</span>
										<span class="bCur" v-if="item.lift=='Y'">电梯</span>
										<!-- <span class="bCur" v-bind:key="ind"
											v-for="(obj, ind) in item.label">{{obj}}</span> -->
									</view>
									<view class="mon">
										租金： <span class="mon-y">{{item.monthPrice}}</span><span class="mon-s">元/月</span>
									</view>


									<img v-if="item.checked==true" class="sc" @tap.stop="collect(item,0)"
										src="../../static/ysc.png" alt="">

									<img v-else class="sc" @tap.stop="collect(item,1)" src="../../static/sc.png" alt="">
								</view>
							</view>

						</li>
						<div class="load" v-show="isLoadDowning == 1">
							<img class="loadImg" src="https://gateway.yijushenyang.com//static/img/loading.png" alt="">
							<span>加载中</span>
						</div>
						<div class="load" v-show="isLoadDowning == 2">
							<span>没有更多了～</span>
						</div>
					</ul>
					<view v-else style="text-align: center; font-size: 14px;">
						<img src="https://gateway.yijushenyang.com//img/none.png"
							style="margin: 0 auto; margin-top: 40px; width: 50px; height:50px;" alt="">
						<view class="" style="margin-top: 10px; color: #999;">
							暂无数据
						</view>
					</view>
				</scroll-view>
			</div>

			<!--户型配套-->
			<div class="wrap" style="padding: 20px 10px;box-shadow: unset;" v-show="navValue == 1">
				<div class="title" style="margin-bottom: 25rpx;">户型配套</div>
				<div class="ptUl around-p-bg">
					<div class="ptli" v-for="(i,id) in info.pieceList" :key="id">
						<img :src="i.iconUrl" alt="">
						<p>{{i.iconName}}</p>
					</div>
				</div>
				<div v-if="info.modelIntroduce" class="ptP" style="color: #000;">
					介绍: {{info.modelIntroduce}}
				</div>

				<div class="ptMost" @click="most()">查看更多</div>
				<uni-popup ref="popup" type="bottom" background-color="#fff" safe-area:true :mask-click="false">
					<scroll-view class="popup" scroll-y="true">
						<div style="padding: 20rpx;">
							<div class="h">
								<div class="h1">户型介绍</div>
								<img class="close_icon" src="../../static/close.png" alt="" @click="close">
							</div>
							<div style="height: 60rpx;"></div>
							<div style="margin: 20rpx 0;font-size: 32rpx;font-weight: bold;">户型图</div>
							<image style="width:100%;margin: 0 auto;display: flex;" mode="heightFix"
								:src="info.modelImgUrl" alt="">
							</image>
							<div style="margin: 20rpx 0;font-size: 32rpx;font-weight: bold;">户型配套</div>
							<div class="ptUl">
								<div class="ptli" v-for="(i,id) in info.pieceList" :key="id">
									<img :src="i.iconUrl" alt="">
									<p>{{i.iconName}}</p>
								</div>
							</div>
							<div v-if="info.modelIntroduce" class="pupopP" style="color: #000;">
								介绍: {{info.modelIntroduce}}
							</div>
							<div style="width: 100%;height: 200rpx;"></div>
							<div class="pupopBtn" @click="close">我知道了</div>
						</div>
					</scroll-view>
				</uni-popup>
			</div>
		</div>

		<!--位置周边-->
		<div class="wrap" style="padding: 20px 10px;">
			<div class="title">位置周边</div>
			<div class="weizhi">
				<!-- <div class="weizhiPo">
					<img src="../../static/dw.png"
						style="width: 15px; height: 16px; margin-left: 10px; margin-right: 4px;" alt="">
					<span>沈阳市铁西区南十三路10号（万达广场旁）</span>
				</div> -->
				<map style="width: 100%; height: 150px;" :layer-style='5' :show-location='false' :latitude="latitude"
					:longitude="longitude" :markers="marker" :scale="scale" @markertap="markertap"
					@callouttap='callouttap'></map>
			</div>
		</div>

		<!-- 住房须知 -->
		<div class="wrap wraps" style="padding: 20px 10px;margin-bottom: 8px;">
			<div class="title" style="margin-bottom: 10rpx;">住房须知</div>
			<div class="around-p around-p-bg">
				<rich-text class="around-p" :nodes="newContent"></rich-text>
			</div>
		</div>

		<!--常见问题-->
		<div class="wrap" style="padding: 20px 10px;" v-show="polenth!=0">
			<div class="title">常见问题</div>
			<div class="cjwt">
				<div class="cjwtli" v-for="(item,index) in questList" :key="index" @tap.stop="quesmost()">
					<!-- <img src="../../static/xx.png" style="width: 15px; height: 16px;  margin-right: 4px;" alt=""> -->
					<span>{{item.title}}</span>
				</div>
			</div>
		</div>
		<uni-popup ref="popups" type="bottom" background-color="#fff" safe-area:true :mask-click="false">
			<scroll-view class="popup" scroll-y="true">
				<div class="h">
					<div class="h1">常见问题</div>
					<img class="close_icon" src="../../static/close.png" alt="" @click="quesclose">
				</div>
				<div style="height: 60rpx;"></div>
				<div class="ques">
					<div v-for="(item,index) in questList" :key="index">
						<div class="ques-h">{{item.title}}</div>
						<rich-text class="ques-p" :nodes="item.content"></rich-text>
					</div>

				</div>
				<div style="width: 100%;height: 200rpx;"></div>
				<div class="pupopBtn" @click="quesclose">我知道了</div>
			</scroll-view>
		</uni-popup>
		<!--附近门店推荐-->
		<!-- <div class="wrap" style="padding: 20px 10px;">
			<div class="title">附近门店推荐</div>
			<div class="fjmd">
				<div class="fjmdLi" v-for="i in 3">
					<img src="../../static/shouc.png" style="width: 130px; height: 95px;" alt="">
					<div class="fjmdtitle">沈阳市铁西</div>
					<div class="fjmdtip">距沈辽路站898m</div>
					<div class="fjmdmoney"><span class="bRed">1990</span> <span style="font-size: 12px;">元/月</span>
					</div>
				</div>
			</div>
		</div>
		 -->
		<!--周边设施-->
		<div class="wrap" style="padding: 20px 10px;">
			<div class="title">周边设施</div>
			<div class="around">
				<div v-if="othList.life">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">生活配套</div>
					<div class="around-p around-p-bg">{{othList.life}}</div>
				</div>
				<div v-if="othList.doctor">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">医疗设施</div>
					<div class="around-p around-p-bg">{{othList.doctor}}</div>
				</div>
				<div v-if="othList.school">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">中小学校</div>
					<div class="around-p around-p-bg">{{othList.school}}</div>
				</div>
				<div v-if="othList.tourism">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">旅游景点</div>
					<div class="around-p around-p-bg">{{othList.tourism}}</div>
				</div>
				<div v-if="othList.entertainment">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">休闲娱乐</div>
					<div class="around-p around-p-bg">{{othList.entertainment}}</div>
				</div>
				<div v-if="othList.body">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">体育设施</div>
					<div class="around-p around-p-bg">{{othList.body}}</div>
				</div>
				<div v-if="othList.meal">
					<div class="around-h"><img class="left-lab" src="../../static/title-icon.png" alt="">饭馆餐厅</div>
					<div class="around-p around-p-bg">{{othList.meal}}</div>
				</div>
			</div>
		</div>

		<!--楼盘tab 底部咨询-->
		<view class="footer" v-show="showpopup== false">
			<view class="footerShare" style="position: relative;" @click="shareClick">
				<button @click="makePhone"
					style="position: absolute; top: 0; width: 100%; height: 100%; opacity: 0;"></button>
				<img src="../../static/phone.png" style="width: 20px; height: 20px;" alt="">
				<view style="color: #777;">电话</view>
			</view>
			<view class="btn-box">
				<view class="footerBtm footerBtm2 footerBtm-l" @click="clickWx">
					微信管家
				</view>
				<view class="footerBtm footerBtm-r" @click="yykfClick">
					预约看房
				</view>
			</view>
		</view>
		<!--预约看房-->
		<div class="fixedBj" v-if='yykfBool' @click="yykfClick">
			<view class="yykfPo">
				<div class="yykfPotitl">预约现场带看</div>
				<div class="yykfchoose">
					<div class="yykft">选择看房时间</div>
					<div style="overflow: auto; margin-top: 10px;">
						<div class="yykfTime">
							<div class="yykftimeLi cur" :class="i.checked==true?'yykftimeLichecked':''"
								v-for="(i,id) in week" :key="id" @tap.stop="getDay(i,id)">
								<div style="font-size: 12px;">{{i.date}}</div>
								<div style="font-size: 12px; ">{{i.day}}</div>
							</div>
						</div>
					</div>

				</div>
				<div class="tjbtm" @tap.stop="reservation()">立即预约</div>
			</view>
		</div>
	</view>
</template>

<script>
	import config from '../../config.js';
	export default {
		data() {
			return {
				yykfBool: false,
				navValue: 0,
				navLiRadio: 0,
				pageNum: 1,
				pageSize: 10,
				popup: false,
				popups: false,
				jg: false,
				showpopup: false,
				questList: [],
				navLi: [{
					h: '可租房源',
					checked: true,
				}, {
					h: '户型介绍',
					checked: false,
				}],
				screen: [{
						h: '阳台'
					}, {
						h: '厨房'
					},
					{
						h: '电梯'
					},
				],
				screen_h: [{
						h: '楼层',
						checked: true,
					},
					// {
					// 	h: '价格',
					// 	checked: false,
					// }
				],

				openId: '4',
				// openId: uni.getStorageSync('openId'),

				list: [],
				modelIndex: 0,
				plateObj: {}, // 总信息
				background: [],
				tipList: [],
				modelList: [], // 户型
				latitude: 41.807345, //纬度
				longitude: 123.36663,
				scale: 12, //缩放级别
				iconPath: '/static/location.png',
				bottomData: false,
				marker: [{
					id: 0,
					latitude: 41.807345, //纬度
					longitude: 123.36663,
					width: 40, //宽
					height: 40, //高
					iconPath: '/static/location.png',
					// title: '我在这里', //标注点名
					alpha: 1, //透明度
				}],

				bannar: [{
					img: 'https://img1.baidu.com/it/u=2071882729,1155120011&fm=253&fmt=auto&app=138&f=JPEG?w=695&h=500'
				}, {
					img: 'https://img1.baidu.com/it/u=2071882729,1155120011&fm=253&fmt=auto&app=138&f=JPEG?w=695&h=500'
				}, {
					img: 'https://img1.baidu.com/it/u=2071882729,1155120011&fm=253&fmt=auto&app=138&f=JPEG?w=695&h=500'
				}],

				currentPages: 1,
				loadBottom: true,
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500,

				id: 0,
				keyword: '',
				otherList: [],
				rows: [],
				room: {},
				swiperlist: [],
				tagList: [],
				village: {},
				user: {},
				storeId: '',
				modelId: '',
				deptId: '',
				modelList: '',
				info: [],
				othList: [],
				newContent: '',
				week: [],
				reservationTime: '',
				polenth: 0,
			}
		},
		computed: {
			mapheight() {
				let data = ''
				if (this.bottomData) {
					if (this.upTop) {
						data = '50px'
					} else {
						data = '200px'
					}
				} else {
					data = '90vh'
				}
				return data
			},
			coverbottom() {
				let data = ''
				if (this.bottomData) {
					data = '20rpx'
				} else {
					data = '100rpx'
				}
				return data
			}
		},
		onLoad: function(option) {
			console.log(option)
			this.infoFun(option.modelId)
			this.deptId = option.deptId
			this.modelId = option.modelId
			this.modeList()
			// this.getAdd()
			this.getAdd()
			this.getweek()
		},

		onReady() {
			this.quesList()
			this.othersList()
		},

		onShow() {},
		onShareAppMessage(res) { //发送给朋友
			return {
				title: '逸居盛京-' + this.plateObj.nickname,
				path: '/pages/builds/detail?id=' + this.plateObj.plateId,
				imageUrl: "",
			}
		},
		onShareTimeline(res) { //分享到朋友圈
			return {
				title: '逸居盛京-' + this.plateObj.nickname,
				path: '/pages/builds/detail?id=' + this.plateObj.plateId,
				imageUrl: '',
			}
		},

		methods: {
			getDay(item, id) {
				for (let l = 0; l < this.week.length; l++) {
					if (id == l) {
						this.$set(this.week[l], 'checked', !item.checked)
						continue
					} else {
						this.$set(this.week[l], 'checked', false)
					}
				}
			},

			reservation() {
				for (let l = 0; l < this.week.length; l++) {
					if (this.week[l].checked == true) {
						this.reservationTime = this.week[l].year
						break
					} else {
						this.reservationTime = ''
					}
				}

				let data = {
					openId: uni.getStorageSync('openId'),
					reservationPhone: uni.getStorageSync('phone'),
					reservationTime: this.reservationTime,
					deptId: this.id,
				}
				if (uni.getStorageSync('openId')) {
					if (this.reservationTime == '') {
						uni.showToast({
							title: '请选择预约时间',
							icon: 'none',
							duration: 2000
						});
					} else {
						this.api.post('system/reservation/app/insert', data).then(res => {
							if (res.data.code == 200) {
								console.log(res.data)
								uni.showToast({
									title: '预约成功',
									icon: 'success',
									duration: 2000
								});
								this.yykfClick()
							} else {
								uni.showToast({
									title: res.data.msg,
									icon: 'none',
									duration: 2000
								});
							}
						})

					}
				} else {
					this.loginTip()
				}
			},

			getweek() {
				let date = new Date();
				let weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
				console.log('获取当前日期和星期', date)

				// 获取星期几的索引
				let dayOfWeekIndex = date.getDay();
				console.log('获取星期几的索引', dayOfWeekIndex)

				// 获取当天的日期和星期
				let dayOfMonth = date.getDate();
				let month = date.getMonth() + 1; // 月份从0开始，需要加1
				let year = date.getFullYear();

				// 输出当前日期和星期
				console.log('输出当前日期和星期=', "Today is " + month + "/" + dayOfMonth + "/" + year + ", " + weekdays[
					dayOfWeekIndex] + ".");

				// 获取接下来一周的每天日期和星期
				let nextDays = [];
				for (let i = 0; i < 7; i++) {
					let nextDate = new Date(date.getTime() + (i * 24 * 60 * 60 * 1000)); // 加上一天的时间差
					nextDays.push({
						date: nextDate.getDate(),
						month: nextDate.getMonth() + 1,
						year: nextDate.getFullYear(),
						dayOfWeek: weekdays[nextDate.getDay()]
					});
				}

				// 输出接下来一周的每天日期和星期
				console.log("Next 7 days:");
				let week = []
				for (let i = 0; i < 7; i++) {
					let date = nextDays[i].month + "-" + nextDays[i].date
					let year = nextDays[i].year + "-" + nextDays[i].month + "-" + nextDays[i].date
					let day = nextDays[i].dayOfWeek
					week.push({
						date: date,
						day: day,
						year: year,
						checked: false,
					})
				}
				this.week = week
			},

			loginTip() {
				uni.showToast({
					title: '请登陆',
					icon: 'none',
					duration: 2000
				});
				setTimeout(() => {
					uni.reLaunch({
						url: '/pages/login/login'
					})
				}, 2000);
			},

			collectFun() {
				let data = {
					deptId: this.id,
					openId: uni.getStorageSync('openId'),
				}

				this.api.get('system/collect/app/selByOpenId', data).then(res => {
					this.collectList = res.data.data

					for (let l = 0; l < this.rows.length; l++) {
						this.$set(this.rows[l], 'checked', false)

						for (let i = 0; i < this.collectList.length; i++) {
							if (this.collectList[i].roomId == this.rows[l].roomId) {
								this.$set(this.rows[l], 'checked', true)
								// continue
								break
							} else {
								this.$set(this.rows[l], 'checked', false)
							}
						}
					}
				})
			},

			// 收藏功能
			collect(item, index) {
				console.log(item, index)
				let data = {
					roomId: item.roomId,
					modelId: item.modelId,
					deptId: item.deptId,
					openId: uni.getStorageSync('openId'),
					type: index
				}
				if (uni.getStorageSync('openId')) {
					this.api.post('system/collect/app/insertAndDelete', data).then(res => {
						if (res.data.code == 200) {
							if (index == 1) {
								this.$set(item, 'checked', true)
							} else {
								this.$set(item, 'checked', false)
							}
							conosle.log(item.checked)
						} else if (res.data.code == 500) {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
						}
					})
				} else {
					this.loginTip()
				}
			},

			lower() {
				if (this.loadBottom) {
					this.pageNum += 1;
					if (this.pageNum <= Math.ceil(this.modelList.total / this.pageSize)) {
						this.isLoadDowning = 1
						this.modeList()
					}
				} else {
					this.isLoadDowning = 2
				}
			},

			formatRichText(html) {
				//控制小程序中图片大小
				let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
					console.log(match.search(/style=/gi));
					if (match.search(/style=/gi) == -1) {
						match = match.replace(/\<img/gi, '<img style=""');
					}
					return match;
				});

				newContent = newContent.replace(/style="/gi, '$& max-width:100% !important; ');
				newContent = newContent.replace(/<br[^>]*\/>/gi, '');
				//过滤pre标签
				newContent = newContent.replace(/<(\/)?pre[^>]*>/gi, '');
				this.newContent = newContent
				return newContent;
			},

			vr(e) {
				uni.navigateTo({
					url: '/pages/builds/vr?id=' + e.modelId
				})
			},
			makePhone() {
				uni.makePhoneCall({
					phoneNumber: this.othList.housekeepPhone,
					success: function() {
						console.log("拨打电话成功！")
					},
					fail: function() {
						console.log("拨打电话失败！")
					}
				});
			},

			linkDetail(item) {
				console.log(item.modelId)
				uni.navigateTo({
					url: '/pages/builds/room-detail?roomId=' + item.roomId + '&deptId=' + this.deptId +
						'&modelId=' + item.modelId
				})
			},
			most() {
				this.$refs.popup.open()
				this.popup = true
				this.showpopup = true
			},

			close() {
				this.$refs.popup.close()
				this.popup = false
				this.showpopup = false
			},

			othersList() {
				let pream = {
					deptId: this.deptId
				}
				this.api.get('fangyuan/store/app/storeAppPeriphery', pream).then(res => {
					// console.log(res)
					if (res.data.code == 200) {
						this.othList = res.data.data
						this.formatRichText(this.othList.rentalNotice)
					}
				})
			},

			preview(index) {
				uni.previewImage({
					current: index,
					urls: this.info.modelImgListUrl.map(x => x)
				})
			},

			quesmost() {
				this.$refs.popups.open()
				this.popups = true
				this.showpopup = true
			},

			quesclose() {
				this.$refs.popups.close()
				this.popups = false
				this.showpopup = false
			},

			quesList() {
				const $this = this
				let pream = {
					deptId: this.deptId
				}
				$this.api.get('fangyuan/store/app/storeAppProblem', pream).then(res => {
					if (res.data.code == 200) {
						this.questList = res.data.data
						this.polenth = res.data.data.length

					}
				})
			},

			getAdd() {
				let pream = {
					deptId: this.deptId,
				}
				this.api.get('fangyuan/store/app/storeAppLatAndLong', pream).then(res => {
					if (res.data.code == 200) {

						this.marker[0].longitude = res.data.data.lon
						this.longitude = res.data.data.lon
						this.marker[0].latitude = res.data.data.lat
						this.latitude = res.data.data.lat
					}
				})
			},

			navLine(index) {
				let id = index
				this.navValue = id
				let item = this.navLi
				for (var i = 0, lenI = item.length; i < lenI; ++i) {
					const items = item[i]
					if (id == i) {
						this.$set(items, 'checked', true)
						continue
					} else {
						this.$set(items, 'checked', false)
					}
				}
			},

			tabItemChecked(index) {
				let id = index
				let item = this.screen_h
				// console.log(item[id].h == '价格')
				if (item[id].h == '价格') {
					this.$nextTick(() => {
						this.jg == true
					})
				} else {
					this.$nextTick(() => {
						this.jg == false
					})
				}

				for (var i = 0, lenI = item.length; i < lenI; ++i) {
					const items = item[i]
					if (id == i) {
						this.$set(items, 'checked', true)
						continue
					} else {
						this.$set(items, 'checked', false)
					}
				}
			},

			yykfClick() {
				// uni.showToast({
				// 	title: '此功能暂未开放',
				// 	icon: 'none',
				// 	duration: 1500,
				// });
				this.yykfBool = !this.yykfBool
			},
			clickWx() {
				uni.navigateTo({
					url: '/pages/wxuqrCode/index?deptId=' + this.deptId
				})
			},
			infoFun(modelId) {
				let pream = {
					modelId: modelId
				}
				this.api.get('fangyuan/store/app/appByModelId', pream).then(res => {
					if (res.data.code == 200) {
						this.info = res.data.data
						// this.isLoadDowning = 0
						// this.showNav = false
					}
				})
			},
			modeList() {
				const $this = this
				let old = $this.rows
				let pream = {
					modelId: $this.modelId,
					pageNum: $this.pageNum,
					pageSize: $this.pageSize,
				}
				$this.api.get('fangyuan/store/app/storeAppByDeptId', pream).then(res => {
					if (res.data.code == 200) {
						this.isLoadDowning = 0
						let news = res.data.rows
						this.modelList = res.data
						if ($this.pageNum == 1) {
							this.rows = res.data.rows
						} else {
							this.rows = old.concat(news)
						}

						// for (let l = 0; l < this.rows.length; l++) {
						// 	this.$set(this.rows[l], 'checked', false)
						// }

						this.collectFun()

						if (res.data.rows.length < res.data.total) {} else {
							this.isLoadDowning = 2
							this.loadBottom = false
						}
					}
				})
			},
			convert2TecentMap(lng, lat) {
				if (lng == '' && lat == '') {
					return {
						lng: '',
						lat: ''
					}
				}
				var x_pi = 3.14159265358979324 * 3000.0 / 180.0
				var x = lng - 0.0065
				var y = lat - 0.006
				var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi)
				var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi)
				var qqlng = z * Math.cos(theta)
				var qqlat = z * Math.sin(theta)
				return {
					lng: qqlng,
					lat: qqlat
				}
			},
			lpFun(houseId) {
				uni.request({
					url: config.host + 'system/plate/app/lp?name=' + houseId,
					success: (res) => {

					}
				})
			},
			choosemodel(index) {
				this.modelIndex = index
			},
			lookTV() {
				// console.log(this.plateObj.path + this.plateObj.broadcastNum)
				uni.navigateToMiniProgram({
					appId: this.plateObj.appId,
					path: this.plateObj.path + this.plateObj.broadcastNum + "&is_vertical=1",
					success(res) {
						// 打开成功 
					},
					complete: (res) => {
						// console.log('直播间信息', res)
					},
				})
			},
			//在线选房
			chooseLink() {
				uni.navigateTo({
					url: '/pages/builds/choose?id=' + this.plateObj.plateId
				})
			},
			shareClick() {
				//分享
				uni.share({

				})
			},
			phoneCall() {
				//拨打固定电话
				uni.makePhoneCall({
					phoneNumber: this.plateObj.salePhone,
				});
			},
			// vr
			vrLink() {
				uni.navigateTo({
					url: '/pages/builds/vr?id=' + this.plateObj.plateId + '&vrtype=' + this.plateObj.vrtype
				})
			},

			markertap(e) {
				// console.log("===你点击了标记点===", e)
			},
			//地图点击事件
			callouttap(e) {
				// console.log('地图点击事件', e)
			},
			// 切换
			currentChange(index) {
				this.currentPages = index
			},
			showImg(src) {
				// console.log(src);
				// 预览图片
				uni.previewImage({
					current: src,
					urls: [src]
				});
			},
			showImgList(index, arr) {
				let imgArr = arr.map(val => {
					return val.modelUrl
				})
				// console.log(imgArr);
				// 预览图片
				uni.previewImage({
					current: index,
					urls: imgArr
				});
			}

		},
	}
</script>

<style>
	@import '/common/css/detail/detail.scss';
</style>

<style lang="scss">
	.wrap {
		margin-top: 0;
		box-shadow: 0.5px 0.5px 5px 0px rgba(0, 0, 0, 0.1);
	}

	.mon {
		color: black;
		margin-top: 20rpx;
		font-size: 24rpx
	}

	.around {
		margin: 20rpx 0;
	}

	.ques-h {
		width: 100%;
		font-size: 28rpx;
		font-weight: bold;
		margin: 15rpx 0;
	}

	.ques-p {
		width: 100%;
		font-size: 24rpx;
		color: #333;
		margin: 5rpx 0 20rpx;
	}

	.ques {
		padding: 20rpx;
	}

	.navs {
		display: flex;
		height: 50px;
		width: 100%;
		background: linear-gradient(90deg, #fffaeb 0%, #fffdf3 100%);
	}

	.navLis {
		position: relative;
		font-size: 18px;
		color: #333;
		margin: 0 15px;
		line-height: 50px;
	}

	.navLines {
		display: none;
		position: absolute;
		width: 35px;
		height: 3px;
		bottom: 5px;
		left: 0px;
		background: linear-gradient(90deg, #ff7336 0%, #ff9b28 100%);
	}

	.navcurs {
		color: #ff9b28;
	}

	.navcur .navLine {
		display: block;
	}

	.wrapss {
		position: relative;
		margin: 0 6px;
		margin-top: -80rpx;
		margin-bottom: 25rpx;
		z-index: 99;
	}
</style>